﻿using System;

class Program
{
    static bool IsPrime(int number)
    {
        if (number <= 1) return false;
        if (number <= 3) return true;
        if (number % 2 == 0 || number % 3 == 0) return false;

        for (int i = 5; i * i <= number; i += 6)
        {
            if (number % i == 0 || number % (i + 2) == 0)
                return false;
        }

        return true;
    }

    static void Main(string[] args)
    {
        Console.Write("请输入一个整数：");
        int number = Convert.ToInt32(Console.ReadLine());

        if (IsPrime(number))
        {
            Console.WriteLine($"数字 {number} 是一个素数，没有其他素数因子。");
        }
        else
        {
            Console.Write("数字 {0} 的素数因子有：");
            for (int i = 2; i <= number; i++)
            {
                while (number % i == 0 && IsPrime(i))
                {
                    Console.Write(i + " ");
                    number /= i;
                }
            }
            Console.WriteLine();
        }
    }
}
